		<xsl:stylesheet version='2.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
			xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:csharp="http://csharp.org"
			xmlns:cap = 'urn:oasis:names:tc:emergency:cap:1.1'
			xpath-default-namespace='urn:oasis:names:tc:emergency:cap:1.1'
			xmlns:gml='http://www.opengis.net/gml' 			
		>
		
<xsl:import href="Area Scripts.xsl"/>

<xsl:variable name="header">
  CAP v1.1 Alert
</xsl:variable>	

<xsl:output method="html" indent="yes" exclude-result-prefixes="msxsl csharp"/>


		
			<xsl:template match="*">
		
				<HTML>
				<HEAD>
				
					<STYLE TYPE="text/css">
						.nothing
						   {
						   padding-left: 0pt;
						   padding-right: 0pt;
						   }
					
						.indented
						   {
						   padding-left: 50pt;
						   padding-right: 50pt;
						   }
						   
						  .indented2
						   {
						   padding-left: 75pt;
						   padding-right: 50pt;
						   }
						   
						   .indented3
						   {
						   padding-left: 100pt;
						   padding-right: 50pt;
						   }
						   
						   .indented4
						   {
						   padding-left: 125pt;
						   padding-right: 50pt;
						   }
					</STYLE>
					
					
					
					
					<style type="text/css">
					  #map-canvas {
						height: 500px;
					  }
					</style>



          <script type="text/javascript">
            <xsl:value-of select="document('CommonJavascript.js')" disable-output-escaping="yes" />
          </script>
				
					<TITLE><xsl:copy-of select="$header" /></TITLE>
					<link rel="stylesheet" media="screen" type="text/css" href="css/style.css" />
				</HEAD>
				<BODY>

				
				
				
					<TABLE bordercolor="#ababab" border="1px" cellpadding="5" cellspacing="0" width="800">

					<TR>
					<TD  bgcolor="#F2F2F2">
							
									<xsl:for-each select="/cap:alert">

										<P CLASS="nothing">
											<b><xsl:copy-of select="$header" /></b>
											<TABLE bordercolor="#ababab" align="center" border="1px" cellpadding="5" cellspacing="0" width="800">
												<tr><td>
													<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="800">
														<tr>
															<td>
																<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="400">
																	<tr>
																		<td  colspan="1" ><b>Identifier: </b></td>
																		<td  colspan="1" ><xsl:value-of select="cap:identifier"/></td>
																	</tr>
																</TABLE>
															</td>
															<td>
																<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="400">
																	<tr>
																		<td  colspan="1" ><b>Sent: </b></td>
																		<td  colspan="1" >
																		<script type="text/javascript">
																		document.write(TimeStampToDate("<xsl:value-of select="cap:sent"/>"));
																		</script>
																		</td>
																	</tr>
																</TABLE>
															</td>
														</tr>
													</TABLE>
												</td></tr>
												<tr><td>
													<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="800">
														<tr>
															<td>
																<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="400">
																	<tr>
																		<td  width="50" ><b>Codes: </b></td>
																	</tr>
																	<tr>
																	<td></td>
																		<td>
																			<xsl:for-each select="cap:code">
																				<xsl:value-of select="."/><BR/>
																			</xsl:for-each>
																		</td>
																	</tr>
																</TABLE>
															</td>
															<td>
																<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="400">
																	<tr>
																		<td  width="80" colspan="1" ><b>Sender: </b></td>
																		<td  colspan="1" ><xsl:value-of select="cap:sender"/></td>
																	</tr>
																	<tr>
																		<td  width="80" colspan="1" ><b>Adresses: </b></td>
																		<td  colspan="1" ><xsl:value-of select="cap:addresses"/></td>
																	</tr>
																</TABLE>
															</td>
														</tr>
													</TABLE>
												</td></tr>
												<tr><td>
													<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="800">
														<tr>
															<td>
																<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="400">
																	<tr>
																		<td><b>Incidents: </b><xsl:value-of select="cap:incidents"/></td>
																		
																	</tr>
																	<tr>
																		<td><b>Source: </b><xsl:value-of select="cap:source"/></td>
																	</tr>
																	<tr>
																		<td height="10"></td>
																	</tr>
																	<tr>
																		<td colspan="2">
																			<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="400" >
																				<tr>
																					<td>
																						<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="200" >
																							<tr>
																								<td  width="60" colspan="1" ><b>Scope: </b></td>
																								<td  colspan="1" ><xsl:value-of select="cap:scope"/></td>
																							</tr>
																						</TABLE>
																						
																					</td>	
																					
																					<td>
																						<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="200" >
																							<tr>
																								<td  width="90" colspan="1" ><b>Restriction: </b></td>
																								<td  colspan="1" ><xsl:value-of select="cap:restriction"/></td>
																							</tr>
																						</TABLE>
																					</td>
																				</tr>
																			</TABLE>
																		</td>
																	</tr>
																	<tr>
																		<td colspan="2">
																			<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="400" >
																				<tr>
																					<td>
																						<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="200" >
																							<tr>
																								<td  width="60" colspan="1" ><b>Status: </b></td>
																								<td  colspan="1" ><xsl:value-of select="cap:status"/></td>
																							</tr>
																						</TABLE>
																						
																					</td>	
																					
																					<td>
																						<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="200" >
																							<tr>
																								<td  width="90" colspan="1" ><b>MsgType: </b></td>
																								<td  colspan="1" ><xsl:value-of select="cap:msgType"/></td>
																							</tr>
																						</TABLE>
																					</td>
																				</tr>
																			</TABLE>
																		</td>
																	</tr>
																</TABLE>
															</td>
															<td>
																<TABLE bordercolor="#ababab" border="0px" cellpadding="0" cellspacing="0" width="400">
																	<tr>
																		<td  colspan="1" ><b>Note: </b></td>
																		<td  colspan="1" ><xsl:value-of select="cap:note"/></td>
																	</tr>
																	<tr>
																		<td  colspan="1" ><b>References: </b></td>
																		<td  colspan="1" ><xsl:value-of select="cap:references"/></td>
																	</tr>
																</TABLE>
															</td>
														</tr>
													</TABLE>
												</td></tr>
											</TABLE>

										</P>
										
									
										
										
										
										
										<P CLASS="indented2">	
											<xsl:for-each select="cap:info">
											
												<P CLASS="nothing">
													
													
													<TABLE bordercolor="#ababab" align="center" border="1px" cellpadding="0" cellspacing="0" width="300">
														<tr>
															<td>
																<TABLE bordercolor="#ababab" border="0px" cellpadding="10" cellspacing="0" width="300">
																	<tr>
																		<td  colspan="1" ><b>Headline: </b></td>
																		<td  colspan="1" ><xsl:value-of select="cap:headline"/></td>
																	</tr>
																	<tr>
																		<td  colspan="1" ><b>Description: </b></td>
																		<td  colspan="1" ><xsl:value-of select="cap:description"/></td>
																	</tr>
																	<tr>
																		<td  colspan="1" ><b>Instruction: </b></td>
																		<td  colspan="1" ><xsl:value-of select="cap:instruction"/></td>
																	</tr>
																</TABLE>
															</td>
														</tr>
													</TABLE>
													
													<br/>
													
													<TABLE bordercolor="#ababab" align="center" border="1px" cellpadding="0" cellspacing="0" width="600">
														<tr><td>
															<TABLE bordercolor="#ababab" border="0px" cellpadding="10" cellspacing="0" width="600">
																<tr>
																	<td>
																		<b>Severity: </b><xsl:value-of select="cap:severity"/>
																	</td>
																	<td>
																		<b>Certainty: </b><xsl:value-of select="cap:certainty"/>
																	</td>
																	<td>
																		<b>Audience: </b><xsl:value-of select="cap:audience"/>
																	</td>
																	<td>
																		<b>Urgency: </b><xsl:value-of select="cap:urgency"/>
																	</td>
																</tr>
															</TABLE>
														</td></tr>
													</TABLE>
													
													<br/>
													
													<TABLE bordercolor="#ababab" align="center" border="0px" cellpadding="10" cellspacing="0" width="600">
													<tr>
														<td colspan="1" >
															<b>Event: </b><xsl:value-of select="cap:event"/><BR/><BR/>
													
															<b>Categories: </b><br/>											
															<P CLASS="indented2">
																<xsl:for-each select="cap:category">
																	
																		<xsl:value-of select="."/><BR/>
																	
																</xsl:for-each>
															</P>
			
															<b>ResponseType: </b>
			
															<P CLASS="indented2">
																<xsl:for-each select="cap:responseType">
																	<xsl:value-of select="."/><BR/>
																</xsl:for-each>
															</P>
															
															<b>Event Codes </b><br/>
															<xsl:for-each select="cap:eventCode">
																• <xsl:value-of select="cap:valueName"/> = <xsl:value-of select="cap:value"/><br/>
															</xsl:for-each>
														</td>
														
														
														
														<td colspan="1" >
															<b>Sender Name: </b><xsl:value-of select="cap:senderName"/><BR/>
															<b>Language: </b><xsl:value-of select="cap:language"/><BR/>
															<BR/>
															<b>Web: </b>
																<a>
																	<xsl:attribute name="href"><xsl:value-of select="cap:web"/></xsl:attribute>
																	<xsl:value-of select="cap:web"/>
																</a><BR/>
															<b>Contact: </b>
																<a>
																	<xsl:attribute name="href">mailto:<xsl:value-of select="cap:contact"/></xsl:attribute>
																	<xsl:value-of select="cap:contact"/>
																</a><BR/>
															<BR/>
															<b>Parameters: </b><br/>
															<xsl:for-each select="cap:parameter">
																• <xsl:value-of select="cap:valueName"/> = <xsl:value-of select="cap:value"/><br/>
															</xsl:for-each>
															<br/>
															
															
															<b>Onset: </b>
															<script type="text/javascript">
															document.write(TimeStampToDate("<xsl:value-of select="cap:onset"/>"));
															</script><BR/>
															
															<b>Effective: </b>
															<script type="text/javascript">
															document.write(TimeStampToDate("<xsl:value-of select="cap:effective"/>"));
															</script><BR/>
															
															<b>Expires: </b>
															<script type="text/javascript">
															document.write(TimeStampToDate("<xsl:value-of select="cap:expires"/>"));
															</script><BR/>
														</td>
													</tr>
													</TABLE>
													
													<br/>
													
													<TABLE bordercolor="#ababab" border="1px" cellpadding="0" cellspacing="0" width="800">
														<tr><td>
															<TABLE bordercolor="#ababab" border="0px" cellpadding="5" cellspacing="0" width="800">
																<tr>
																	<td width="50"><b>Resources: </b></td>
																</tr>

																<xsl:for-each select="cap:resource">
																	<tr>
																		<td>
																		</td>
																		<td>
																			<u><b>Description: </b><xsl:value-of select="cap:resourceDesc"/></u><br/>
																			<b>Type: </b><xsl:value-of select="cap:mimeType"/><br/>
																			<b>Size: </b><xsl:value-of select="cap:size"/><br/>
																			<b>File: </b>
																				<a>
																					<xsl:attribute name="href"><xsl:value-of select="cap:uri"/></xsl:attribute>
																					<xsl:value-of select="cap:uri"/>
																				</a><br/>
																			<b>Embedded Data: </b><xsl:value-of select="cap:derefUri"/><br/>
																			<b>Digest: </b><xsl:value-of select="cap:digest"/><br/><br/>
																		</td>
																	</tr>
																</xsl:for-each>
																
															</TABLE>
														</td></tr>
													</TABLE>
													
													
													
													<br/>
													
													<xsl:for-each select="cap:area">
														
														<TABLE bordercolor="#ababab" align="center" border="1px" cellpadding="3" cellspacing="0">
															<tr><td>
																<b>Area Description: </b><xsl:value-of select="cap:areaDesc"/><BR/><BR/>
																
																<xsl:if test="cap:altitude">
																	<b>Altitude: </b><xsl:value-of select="cap:altitude"/><br/>
																</xsl:if>
																
																<xsl:if test="cap:ceiling">
																	<b>Ceiling: </b><xsl:value-of select="cap:ceiling"/><br/>
																</xsl:if>
																
																<xsl:if test="cap:geocode">
																	<b>Geocodes </b><br/>
																	<xsl:for-each select="cap:geocode">
																		<b><xsl:value-of select="cap:valueName"/> = </b><xsl:value-of select="cap:value"/><br/>
																	</xsl:for-each>
																</xsl:if>
																
																<xsl:for-each select="cap:circle">
																	
																	<xsl:variable name="circleData">
																		<xsl:value-of select="." />
																	</xsl:variable>
																	
																	<b>Circle: </b><xsl:copy-of select="$circleData" /><br/>
																
																	<img border="0" alt="Map">
																		<xsl:attribute name="src">
																			<xsl:value-of select="csharp:circle($circleData)" />
																		</xsl:attribute>
																	</img>
																	
																	
																</xsl:for-each>
																
																<xsl:for-each select="cap:polygon">
																	Polygon:<br/>
																	<xsl:variable name="myLines">
																		<xsl:value-of select="." />
																	</xsl:variable>
																
																	<xsl:variable name="myLinesFixed">
																		<xsl:value-of select="csharp:lines($myLines)" />
																	</xsl:variable>
																	
																	
																	<img border="0" alt="Map">
																		<xsl:attribute name="src">
																			<xsl:copy-of select="$myLinesFixed" />
																		</xsl:attribute>
																	</img>
																	
																</xsl:for-each>
															

															</td></tr>
														</TABLE>
														<br/><br/>
													</xsl:for-each>
													
												</P>
											</xsl:for-each>
											
										</P>
										
									</xsl:for-each>
							
						
					
					</TD>
					</TR>
					</TABLE>
				
				
				
				


				
				</BODY>
				</HTML>
			</xsl:template>
		</xsl:stylesheet>